<?php

require_once "core-application/class.character.php";

// Chiave generica per tutte le pagine che devono essere nell'output principale.
$data['pageOutput'] = '';

$Char = new character;

$chars = $Char -> characterRegistryAll();

for($i = 0; $i <= count($chars)-1; $i++)
{
	$data['pageOutput'] .= '<tr><td>' . $chars[$i]['character_name'] . '</td><td>' . $chars[$i]['character_surname'] . '</td>' . 
	'<td>' . $chars[$i]['character_sex'] . '</td><td>' . $chars[$i]['character_race'] . '</td>' . 
	'<td>' . date('d/m/Y', strtotime($chars[$i]['character_created'])) . '</td><td>' . date('d/m/Y', strtotime($chars[$i]['character_lasttime'])) . ' alle ' . date('H:i', strtotime($chars[$i]['character_lasttime'])) . '</td></tr>';  
}

if( ! empty($_GET['ajax']))
{
	echo json_encode($data['pageOutput']);
}



?>